import request from "@/utils/request";

// 查询转移规则列表
export function transferRulesList(params) {
    return request({
      url: "/ny-iqc/tactics/ruleSort/list",
      method: "get",
      params,
    });
}

// 获取转移规则详细信息
export function getTransferRulesInfo(id) {
  return request({
    url: `/ny-iqc/tactics/ruleSort/${id}`,
    method: "get",
  });
}


// 查询转移规则-规则分类列表
export function carryOutList(params) {
  return request({
    url: "/ny-iqc/tactics/carryOut/list",
    method: "get",
    params,
  });
}
// 新增转移规则-策略执行内容
export function carryOutAdd(data) {
  return request({
    url: "/ny-iqc/tactics/carryOut",
    method: "post",
    data,
  });
}
// 查询转移规则-策略跳转内容列表
export function carryOutEdit(data) {
  return request({
    url: "/ny-iqc/tactics/carryOut",
    method: "PUT",
    data,
  });
}
// 删除转移规则-策略执行内容
export function carryOutDel(id) {
  return request({
    url: "/ny-iqc/tactics/carryOut/"+id,
    method: "delete",
  });
}

// 查询转移规则-规则分类列表
export function skipList(params) {
  return request({
    url: "/ny-iqc/tactics/skip/list",
    method: "get",
    params,
  });
}
// 查询转移规则-策略跳转内容列表
export function skipAdd(data) {
  return request({
    url: "/ny-iqc/tactics/skip",
    method: "post",
    data,
  });
}
// 查询转移规则-策略跳转内容列表
export function skipEdit(data) {
  return request({
    url: "/ny-iqc/tactics/skip",
    method: "PUT",
    data,
  });
}
// 删除转移规则-策略跳转内容
export function skipDel(id) {
  return request({
    url: "/ny-iqc/tactics/skip/"+id,
    method: "delete",
  });
}

// 删除转移规则
export function delTransferRules(ids) {
    return request({
      url: `/ny-iqc/tactics/ruleSort/${ids??''}`,
      method: "delete",
    });
}

// 新增转移规则
export function addTransferRules(data) {
    return request({
      url: '/ny-iqc/tactics/ruleSort',
      method: "post",
      data
    });
}

// 编辑转移规则
export function editTransferRules(data) {
    return request({
      url: '/ny-iqc/tactics/ruleSort',
      method: "put",
      data
    });
}

// 查询转移规则-物料绑定列表
export function getMaterialBindList(params){
  return request({
    url: '/ny-iqc/tactics/materielBind/list',
    method: 'get',
    params
  })
}

// 新增转移规则-物料绑定
export function addMaterialBind(data){
  return request({
    url: '/ny-iqc/tactics/materielBind/materielBind',
    method: 'post',
    data
  })
}

// 删除转移规则-物料绑定
export function delMaterialBind(ids){
  return request({
    url: `/ny-iqc/tactics/materielBind/${ids??''}`,
    method: 'delete',
  })
}

// 修改转移规则-物料绑定
export function editMaterialBind(data){
  return request({
    url: '/ny-iqc/tactics/materielBind',
    method: 'put',
    data
  })
}

// ## 转移规则-修改当前物料的当前策略
export function editMaterialTactics(data){
  return request({
    url: '/ny-iqc/tactics/materielBind/editTactics',
    method: 'put',
    data
  })
}